﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Templates_默认样式 : System.Web.UI.Page
{
    protected string id = null;

    protected void Page_Load(object sender, EventArgs e)
    {
        id = Request.Params["aid"];
        if (id == null || id == "")
        {
            return;
        }

        //加载文章的信息
        TreasurerDataContext db = new TreasurerDataContext();
        var q = from aA in db.Articles
                where aA.ID == id
                select aA;
        if (q.Count() > 0)
        {
            Articles a = q.First();
            TitleLabel.Text = a.Title;
            AuthorLabel.Text = a.Creator.Name;
            PublishedLabel.Text = string.Format("{0:yyyy年MM月dd日 HH:mm:ss}", a.Published);
            BodyLabel.Text = a.Body;

            Page.Title = a.Title;
        }
    }
}